package Class.base;

import java.util.Arrays;

public class Main09 {
    public static void main(String[] args) {
        // 声明内部内容为int的数组
        // 数组需要初始化才能使用
        // 下面两种写法都可以
        // int[] intArrList = new int[]{1,2,3,4,5,6,7};
        int[] intArrList2 = {1, 2, 3, 4, 5, 6, 7};
        System.out.println(Arrays.toString(intArrList2));
        // 字符串类型的数组
        String[] personList = {"袁隆平", "邓稼先", "钱学森"};
        System.out.println(Arrays.toString(personList));
        double[] doublesList = {1.2, 23.5, 7.8, 9.4, 5.4};
        System.out.println(doublesList.length);
        System.out.println(doublesList[0]);
        // 数组的遍历
        for (double item : doublesList) {
            System.out.println(item);
        }
        char[] charsList = new char[26];
        String[] arr2List = new String[26];
        System.out.println(charsList.length);
        System.out.println(Arrays.toString(arr2List));
    }
}
